<?php
if($this->Session->read("login")=="yes")
{
    ?>
    <div class="fileupload read_data">
        <h2><?php echo __('File Upload'); ?></h2>
        <p>Please check the following table with the original CSV file.</p>

        <div  style="white-space:pre; overflow:auto; width:100% ; height:50%;padding:10px;">
            <table cellpadding="0" cellspacing="0">
                <?php
                $maxlines=$this->Session->read("ullines");
                $maxcol=$this->Session->read("ulcols");
                //table header
                echo "<tr>";
                for ($col=1;$col<=$maxcol;$col++)
                {
                    echo "<th>".$this->Session->read("cell[2,".$col."]")."</td>";
                }
                echo "</tr>";
                //table body
                for($line=3;$line<=$maxlines;$line++)
                {
                    echo "<tr>";
                    for($col=1;$col<=$maxcol;$col++)
                    {
                        echo "<td>".$this->Session->read("cell[".$line.",".$col."]")."</td>";
                    }
                    echo "</tr>";
                }
                ?>
            </table>
        </div><br>

        <br><br><br>
        <?php
        echo $this->Form->create($model=false);
        echo $this->Form->submit('Submit', array('div'=>false,
            'name'=>'updatedb' ));?>&nbsp;
    </div>
    <?php
}
else
{
    echo "<p> You can't view the content of this page. </p>";
}
?>
